<?php

namespace App\Models\customer;

use App\Models\AdminModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model as BaseModel;


class ResourceModel extends BaseModel
{
    use HasFactory, SoftDeletes;

    protected $table = 't_customer_resource';

    protected $primaryKey = 'id';

    public $timestamps = true;

    const CREATED_AT = 'created_at';
    
    const UPDATED_AT = null;

    const API_TYPE = [1 => '菜鸟API', 2 => 'lazada'];

    const RESOURCE_TYPE_EML = 1;
    const RESOURCE_TYPE_WAREHOUSE = 2;
    const RESOURCE_TYPE_DELIVERY = 3;
    const RESOURCE_TYPE_EXPORT = 4;

    const RESOURCE_TYPE = [1 => 'eml干线', 2 => '集运仓', 3 => '派送', 4 => '出口关务'];

    protected $guarded = [];

    protected $hidden = [
        'deleted_at',
    ];



    //创建人
    public function create_admin(): BelongsTo {
        return $this->belongsTo(AdminModel::class, 'created_admin_id');
    }
}
